<button>
  Button
</button>
<style>
/* From Uiverse.io by prince192000 - Tags: button */
button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  padding: 15px 30px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: black;
  border: none;
  letter-spacing: 2px;
  font-size: 17px;
}

button:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #03a;
  z-index: -1;
  transition: transform 0.5s;
  transform-origin: bottom right;
  transform: scale(0);
}

button:hover:before {
  transition: transform 0.5s;
  transform-origin: top left;
  transform: scale(1);
}

button:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 2px solid #fff;
  box-sizing: border-box;
  z-index: -1;
  transition: transform 0.5s;
  transform-origin: bottom right;
  transform: scale(1);
}

button:hover:after {
  transition: transform 0.5s;
  transform-origin: top left;
  transform: scale(0);
}
</style>
